<div class="tp_page_title">
	<div class="container">
		<div class="row">
			<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
				<div class="tp_page_heading">
					<h3><?php echo $headlineText;?></h3>
				</div>
			</div>
		</div>
	</div>
</div>
<div class="tp_gray_wrapper tp_toppadder80 tp_bottompadder80">
	<div class="container">
		<div class="row">
			<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
				<div class="tp_filter">
				
					<ul>
                    <?php
					   $c_Active='';
					 
					   if($cate_active==''){
						 $c_Active='active';  
					   }
					 
                        echo '<li><a href="'.$basepath.'home/products" class="'.$c_Active.'" >'.$this->ts_functions->getlanguage('alltext','homepage','solo').'</a></li>';
                        foreach($categoryList as $soloCate) {
							

                            if( $this->ts_functions->getsettings('dontshow','emptycate') == '1' ) {
                                $catename = strtolower($soloCate['cate_urlname']);
                                $catename = str_replace(' ','-',$catename);
                                $catename = preg_replace('!-+!', '-', $catename);

                                $checkProd = $this->DatabaseModel->access_database('ts_products','select','',array('prod_cateid'=>$soloCate['cate_id']));
                                
								$selected='';
								if($cate_active==$catename){
									$selected='active';
								}
                                echo  !empty($checkProd) ? '<li><a href="'.$basepath.'home/products/'.$catename.'" class="'.$selected.'" >'.$soloCate['cate_name'].'</a></li>' : '';
                            }
                            else{
                                $catename = strtolower($soloCate['cate_urlname']);
                                $catename = str_replace(' ','-',$catename);
                                $catename = preg_replace('!-+!', '-', $catename);
								
								$selected='';
								if($cate_active==$catename){
									$selected='active';
								}
                                echo '<li><a href="'.$basepath.'home/products/'.$catename.'" class="'.$selected.'">'.$soloCate['cate_name'].'</a></li>';
                            }
                        }
                    ?>
					</ul>
				</div>
			</div>
			<div id="portfolio" class="tp_filterdata">
		 <?php
		 if( !empty($productdetails) ) {
			foreach($productdetails as $soloFet){
			   $prodName = $this->ts_functions->getProductName($soloFet['prod_id']);
			   $prodImage = $this->ts_functions->getProductPic($soloFet['prod_image']);
			   $prodUrl   = base_url().'item/'. $prodName.$soloFet['prod_uniqid'];
        	   
               $catename = strtolower($soloFet['cate_urlname']);
               $catename = str_replace(' ','-',$catename);
               $catename = preg_replace('!-+!', '-', $catename);
			   $cat_url  =base_url().'home/products/'. $catename;
               $prod_demourl='';
               if($soloFet['prod_demourl']){
				$prod_demourl= base_url().'item/'.$prodName.'live_demo/'.$soloFet['prod_uniqid']; 
			   }
               
			   if( $soloFet['prod_free'] == '0') {
				  $prod_price=$this->ts_functions->getsettings('portalcurreny','symbol').' '.$soloFet['prod_price']; 
			   }else{
				  $prod_price=$this->ts_functions->getlanguage('freetext','commontext','solo'); 
			   }
			   if( $this->ts_functions->getsettings('portal','revenuemodel') != 'subscription' ) {
				   $purDetail = $this->DatabaseModel->access_database('ts_purchaserecord','select','',array('purrec_prodid'=>$soloFet['prod_id']));
				   $prod_sale=count($purDetail);
			   }else{
				  $prod_sale=$soloFet['prod_download_count']; 
			   }
			   
			   $vendorName = $this->ts_functions->getVendorName($soloFet['prod_uid']);
			   $vendo_url=base_url().'vendor/'.$vendorName;
			   
			   ?> 
				<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12 mix mix-all website literature">
						<div class="tp_product_div">
					<div class="tp_product_img" >
						<img src="<?php echo $prodImage; ?>" class="img-responsive" alt="">
						<?php
                         if($prod_demourl!=''){?>
						  <div class="tp_overlay"></div>
							<div class="tp_overlay_btn">
								<a href="<?php echo $prod_demourl; ?>" class="tp_btn" target="_blank"><?php echo $this->ts_functions->getlanguage('livedemotab','homepage','solo');?></a>
							</div>	 
							 
						 <?php }?>
					</div>
					<div class="tp_product_data">
						<h3><a href="<?php echo $prodUrl; ?>"><?php echo $soloFet['prod_name'];  ?></a></h3>
						<p><?php echo substr(strip_tags($soloFet['prod_description']),0,150).' ...';?></p>
						<ul>
							<li><a href="<?php echo $vendo_url;  ?>"><i class="fa fa-user"></i> <?php echo ucfirst($vendorName); ?></a></li>
							<li><a href="<?php echo $cat_url; ?>"><i class="fa fa-tag"></i><?php echo $catename; ?></a></li>
						</ul>
						<div class="tp_divider"></div>
						
						<div class="tp_sales_data">
							<h4><i class="fa fa-shopping-cart"></i> <?php echo $prod_sale.' ' . $this->ts_functions->getlanguage('salestext','commontext','solo'); ?> </h4>
						</div>
						<div class="tp_price_div">
							<h4><?php echo $prod_price; ?></h4>
						</div>
						<div class="tp_btndiv">
							<a href="<?php echo $prodUrl; ?>" class="tp_btn"><?php echo $this->ts_functions->getlanguage('viewbtn','homepage','solo') ?></a>
						</div>
					</div>
				 </div>
				</div>
			<?php } } else { ?>
			<!-- 404 Page STARTS -->
			
			
			<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12" style="text-align: center;">
				<img src="<?php echo $this->ts_functions->getsettings('notfoundimg','url');?>" alt="Oops , there is nothing to show" title="Oops , there is nothing to show">
			</div>
			
			
			<!-- 404 Page ENDS -->
			<?php } ?>
		 <?php	if( !empty($productdetails) ) { ?>
            <div class="col-md-12">
              <div class="tp_pagination_div ">
					<nav aria-label="Page navigation">
						<?php echo (isset($pagination_buttons))?$pagination_buttons:''; ?>
					</nav>
				</div>
            </div>
         <?php } ?>			
				
			</div>
		</div>
	</div>
</div>